var $_, $hxClasses = $hxClasses || {}, $estr = function() { return js.Boot.__string_rec(this,''); }
function $extend(from, fields) {
	function inherit() {}; inherit.prototype = from; var proto = new inherit();
	for (var name in fields) proto[name] = fields[name];
	return proto;
}
var EReg = $hxClasses["EReg"] = function(r,opt) {
	opt = opt.split("u").join("");
	this.r = new RegExp(r,opt);
};
EReg.__name__ = ["EReg"];
EReg.prototype = {
	r: null
	,match: function(s) {
		this.r.m = this.r.exec(s);
		this.r.s = s;
		return this.r.m != null;
	}
	,matched: function(n) {
		return this.r.m != null && n >= 0 && n < this.r.m.length?this.r.m[n]:(function($this) {
			var $r;
			throw "EReg::matched";
			return $r;
		}(this));
	}
	,matchedLeft: function() {
		if(this.r.m == null) throw "No string matched";
		return this.r.s.substr(0,this.r.m.index);
	}
	,matchedRight: function() {
		if(this.r.m == null) throw "No string matched";
		var sz = this.r.m.index + this.r.m[0].length;
		return this.r.s.substr(sz,this.r.s.length - sz);
	}
	,matchedPos: function() {
		if(this.r.m == null) throw "No string matched";
		return { pos : this.r.m.index, len : this.r.m[0].length};
	}
	,split: function(s) {
		var d = "#__delim__#";
		return s.replace(this.r,d).split(d);
	}
	,replace: function(s,by) {
		return s.replace(this.r,by);
	}
	,customReplace: function(s,f) {
		var buf = new StringBuf();
		while(true) {
			if(!this.match(s)) break;
			buf.add(this.matchedLeft());
			buf.add(f(this));
			s = this.matchedRight();
		}
		buf.b[buf.b.length] = s == null?"null":s;
		return buf.b.join("");
	}
	,__class__: EReg
}
var IntIter = $hxClasses["IntIter"] = function(min,max) {
	this.min = min;
	this.max = max;
};
IntIter.__name__ = ["IntIter"];
IntIter.prototype = {
	min: null
	,max: null
	,hasNext: function() {
		return this.min < this.max;
	}
	,next: function() {
		return this.min++;
	}
	,__class__: IntIter
}
var List = $hxClasses["List"] = function() {
	this.length = 0;
};
List.__name__ = ["List"];
List.prototype = {
	h: null
	,q: null
	,length: null
	,add: function(item) {
		var x = [item];
		if(this.h == null) this.h = x; else this.q[1] = x;
		this.q = x;
		this.length++;
	}
	,push: function(item) {
		var x = [item,this.h];
		this.h = x;
		if(this.q == null) this.q = x;
		this.length++;
	}
	,first: function() {
		return this.h == null?null:this.h[0];
	}
	,last: function() {
		return this.q == null?null:this.q[0];
	}
	,pop: function() {
		if(this.h == null) return null;
		var x = this.h[0];
		this.h = this.h[1];
		if(this.h == null) this.q = null;
		this.length--;
		return x;
	}
	,isEmpty: function() {
		return this.h == null;
	}
	,clear: function() {
		this.h = null;
		this.q = null;
		this.length = 0;
	}
	,remove: function(v) {
		var prev = null;
		var l = this.h;
		while(l != null) {
			if(l[0] == v) {
				if(prev == null) this.h = l[1]; else prev[1] = l[1];
				if(this.q == l) this.q = prev;
				this.length--;
				return true;
			}
			prev = l;
			l = l[1];
		}
		return false;
	}
	,iterator: function() {
		return { h : this.h, hasNext : function() {
			return this.h != null;
		}, next : function() {
			if(this.h == null) return null;
			var x = this.h[0];
			this.h = this.h[1];
			return x;
		}};
	}
	,toString: function() {
		var s = new StringBuf();
		var first = true;
		var l = this.h;
		s.b[s.b.length] = "{";
		while(l != null) {
			if(first) first = false; else s.b[s.b.length] = ", ";
			s.add(Std.string(l[0]));
			l = l[1];
		}
		s.b[s.b.length] = "}";
		return s.b.join("");
	}
	,join: function(sep) {
		var s = new StringBuf();
		var first = true;
		var l = this.h;
		while(l != null) {
			if(first) first = false; else s.b[s.b.length] = sep == null?"null":sep;
			s.add(l[0]);
			l = l[1];
		}
		return s.b.join("");
	}
	,filter: function(f) {
		var l2 = new List();
		var l = this.h;
		while(l != null) {
			var v = l[0];
			l = l[1];
			if(f(v)) l2.add(v);
		}
		return l2;
	}
	,map: function(f) {
		var b = new List();
		var l = this.h;
		while(l != null) {
			var v = l[0];
			l = l[1];
			b.add(f(v));
		}
		return b;
	}
	,__class__: List
}
var Reflect = $hxClasses["Reflect"] = function() { }
Reflect.__name__ = ["Reflect"];
Reflect.hasField = function(o,field) {
	return Object.prototype.hasOwnProperty.call(o,field);
}
Reflect.field = function(o,field) {
	var v = null;
	try {
		v = o[field];
	} catch( e ) {
	}
	return v;
}
Reflect.setField = function(o,field,value) {
	o[field] = value;
}
Reflect.getProperty = function(o,field) {
	var tmp;
	return o == null?null:o.__properties__ && (tmp = o.__properties__["get_" + field])?o[tmp]():o[field];
}
Reflect.setProperty = function(o,field,value) {
	var tmp;
	if(o.__properties__ && (tmp = o.__properties__["set_" + field])) o[tmp](value); else o[field] = value;
}
Reflect.callMethod = function(o,func,args) {
	return func.apply(o,args);
}
Reflect.fields = function(o) {
	var a = [];
	if(o != null) {
		var hasOwnProperty = Object.prototype.hasOwnProperty;
		for( var f in o ) {
		if(hasOwnProperty.call(o,f)) a.push(f);
		}
	}
	return a;
}
Reflect.isFunction = function(f) {
	return typeof(f) == "function" && f.__name__ == null;
}
Reflect.compare = function(a,b) {
	return a == b?0:a > b?1:-1;
}
Reflect.compareMethods = function(f1,f2) {
	if(f1 == f2) return true;
	if(!Reflect.isFunction(f1) || !Reflect.isFunction(f2)) return false;
	return f1.scope == f2.scope && f1.method == f2.method && f1.method != null;
}
Reflect.isObject = function(v) {
	if(v == null) return false;
	var t = typeof(v);
	return t == "string" || t == "object" && !v.__enum__ || t == "function" && v.__name__ != null;
}
Reflect.deleteField = function(o,f) {
	if(!Reflect.hasField(o,f)) return false;
	delete(o[f]);
	return true;
}
Reflect.copy = function(o) {
	var o2 = { };
	var _g = 0, _g1 = Reflect.fields(o);
	while(_g < _g1.length) {
		var f = _g1[_g];
		++_g;
		o2[f] = Reflect.field(o,f);
	}
	return o2;
}
Reflect.makeVarArgs = function(f) {
	return function() {
		var a = Array.prototype.slice.call(arguments);
		return f(a);
	};
}
Reflect.prototype = {
	__class__: Reflect
}
var Std = $hxClasses["Std"] = function() { }
Std.__name__ = ["Std"];
Std["is"] = function(v,t) {
	return js.Boot.__instanceof(v,t);
}
Std.string = function(s) {
	return js.Boot.__string_rec(s,"");
}
Std["int"] = function(x) {
	return x | 0;
}
Std.parseInt = function(x) {
	var v = parseInt(x,10);
	if(v == 0 && x.charCodeAt(1) == 120) v = parseInt(x);
	if(isNaN(v)) return null;
	return v;
}
Std.parseFloat = function(x) {
	return parseFloat(x);
}
Std.random = function(x) {
	return Math.floor(Math.random() * x);
}
Std.prototype = {
	__class__: Std
}
var StringBuf = $hxClasses["StringBuf"] = function() {
	this.b = new Array();
};
StringBuf.__name__ = ["StringBuf"];
StringBuf.prototype = {
	add: function(x) {
		this.b[this.b.length] = x == null?"null":x;
	}
	,addSub: function(s,pos,len) {
		this.b[this.b.length] = s.substr(pos,len);
	}
	,addChar: function(c) {
		this.b[this.b.length] = String.fromCharCode(c);
	}
	,toString: function() {
		return this.b.join("");
	}
	,b: null
	,__class__: StringBuf
}
var browserhx = browserhx || {}
browserhx.BrowserType = $hxClasses["browserhx.BrowserType"] = { __ename__ : ["browserhx","BrowserType"], __constructs__ : ["Chrome","Safari","WebKitOther","FireFox","Opera","IE"] }
browserhx.BrowserType.Chrome = ["Chrome",0];
browserhx.BrowserType.Chrome.toString = $estr;
browserhx.BrowserType.Chrome.__enum__ = browserhx.BrowserType;
browserhx.BrowserType.Safari = ["Safari",1];
browserhx.BrowserType.Safari.toString = $estr;
browserhx.BrowserType.Safari.__enum__ = browserhx.BrowserType;
browserhx.BrowserType.WebKitOther = ["WebKitOther",2];
browserhx.BrowserType.WebKitOther.toString = $estr;
browserhx.BrowserType.WebKitOther.__enum__ = browserhx.BrowserType;
browserhx.BrowserType.FireFox = ["FireFox",3];
browserhx.BrowserType.FireFox.toString = $estr;
browserhx.BrowserType.FireFox.__enum__ = browserhx.BrowserType;
browserhx.BrowserType.Opera = ["Opera",4];
browserhx.BrowserType.Opera.toString = $estr;
browserhx.BrowserType.Opera.__enum__ = browserhx.BrowserType;
browserhx.BrowserType.IE = ["IE",5];
browserhx.BrowserType.IE.toString = $estr;
browserhx.BrowserType.IE.__enum__ = browserhx.BrowserType;
browserhx.Browser = $hxClasses["browserhx.Browser"] = function() { }
browserhx.Browser.__name__ = ["browserhx","Browser"];
browserhx.Browser.__properties__ = {get_hasCanvas2d:"get_hasCanvas2d",get_browserType:"get_BrowserType"}
browserhx.Browser._browserType = null;
browserhx.Browser._userAgent = null;
browserhx.Browser.browserType = null;
browserhx.Browser._hasCanvas2d = null;
browserhx.Browser.hasCanvas2d = null;
browserhx.Browser.get_hasCanvas2d = function() {
	if(browserhx.Browser._hasCanvas2d == null) browserhx.Browser.setHasCanvas2d();
	return browserhx.Browser._hasCanvas2d;
}
browserhx.Browser.setHasCanvas2d = function() {
	haxe.Log.trace(js.Lib.document.createElement("canvas"),{ fileName : "Browser.hx", lineNumber : 40, className : "browserhx.Browser", methodName : "setHasCanvas2d"});
	if(js.Lib.document.createElement("canvas").getContext == null) browserhx.Browser._hasCanvas2d = false; else browserhx.Browser._hasCanvas2d = true;
}
browserhx.Browser.get_BrowserType = function() {
	if(browserhx.Browser._browserType == null) browserhx.Browser.setBrowserType(js.Lib.window.navigator.userAgent);
	return browserhx.Browser._browserType;
}
browserhx.Browser.traceAgent = function() {
	browserhx.Browser.get_BrowserType();
	haxe.Log.trace(browserhx.Browser._userAgent,{ fileName : "Browser.hx", lineNumber : 73, className : "browserhx.Browser", methodName : "traceAgent"});
}
browserhx.Browser.setBrowserType = function(agent) {
	browserhx.Browser._userAgent = agent;
	if(new EReg("WebKit","").match(agent)) {
		if(new EReg("Chrome","").match(agent)) browserhx.Browser._browserType = browserhx.BrowserType.Chrome; else if(new EReg("Safari","").match(agent)) browserhx.Browser._browserType = browserhx.BrowserType.Safari; else browserhx.Browser._browserType = browserhx.BrowserType.Opera;
	} else if(new EReg("Opera","").match(agent)) browserhx.Browser._browserType = browserhx.BrowserType.Opera; else if(new EReg("Mozilla","").match(agent)) {
		var isIE = typeof document!='undefined' && document.all != null && typeof window!='undefined' && window.opera == null;
		if(isIE) browserhx.Browser._browserType = browserhx.BrowserType.IE; else browserhx.Browser._browserType = browserhx.BrowserType.FireFox;
	} else browserhx.Browser._browserType = browserhx.BrowserType.IE;
	return browserhx.Browser._browserType;
}
browserhx.Browser.prototype = {
	__class__: browserhx.Browser
}
var divtastic = divtastic || {}
if(!divtastic.js) divtastic.js = {}
divtastic.js.DisplayDiv = $hxClasses["divtastic.js.DisplayDiv"] = function(img) {
	if(this.isVideo(img)) {
		this._vid = divtastic.js.GlobalDiv.ROOT(this).createElement("video");
		this._dom = this._vid;
	} else if(img == "canvas") this._dom = divtastic.js.GlobalDiv.ROOT(this).createElement("canvas"); else this._dom = divtastic.js.GlobalDiv.ROOT(this).createElement("div");
	this._style = this._dom.style;
	this.isIE = browserhx.Browser.get_BrowserType() == browserhx.BrowserType.IE;
	this.out = new zpartanlite.DispatchTo();
	this.out.tellEnabled = this.outEnabled.$bind(this);
	this.out.tellDisabled = this.outDisabled.$bind(this);
	this.over = new zpartanlite.DispatchTo();
	this.over.tellEnabled = this.overEnabled.$bind(this);
	this.over.tellDisabled = this.overDisabled.$bind(this);
	this.release = new zpartanlite.DispatchTo();
	this.release.tellEnabled = this.releaseEnabled.$bind(this);
	this.release.tellDisabled = this.releaseDisabled.$bind(this);
	this.press = new zpartanlite.DispatchTo();
	this.press.tellEnabled = this.pressEnabled.$bind(this);
	this.press.tellDisabled = this.pressDisabled.$bind(this);
	this.dragging = new zpartanlite.DispatchTo();
	this.dragInform = false;
	this.draggingParent = new zpartanlite.DispatchTo();
	this.setTile(false);
	if(img != null) this.setImage(img);
	this._style.position = "absolute";
};
divtastic.js.DisplayDiv.__name__ = ["divtastic","js","DisplayDiv"];
divtastic.js.DisplayDiv.prototype = {
	isIE: null
	,fixedTextWidth: null
	,fixedTextHeight: null
	,_d: null
	,_negd: null
	,_dom: null
	,_style: null
	,_bgColor: null
	,_img: null
	,_tile: null
	,offSetX: null
	,offSetY: null
	,imageDiv: null
	,viz: null
	,_clientX: null
	,_clientY: null
	,press: null
	,release: null
	,out: null
	,over: null
	,dragging: null
	,draggingParent: null
	,_vid: null
	,_src: null
	,dragInform: null
	,_scale: null
	,_scaleY: null
	,_scaleX: null
	,_alpha: null
	,_rotation: null
	,_angle: null
	,_y: null
	,_x: null
	,_width: null
	,_height: null
	,afflines: null
	,getGlobalMouseXY: function() {
		var globalPos = this.getGlobalXY();
		var pos = new List();
		pos.add(globalPos.first() + this._clientX);
		pos.add(globalPos.last() + this._clientY);
		return pos;
	}
	,getGlobalXY: function() {
		var p = this;
		var gX = p.get_x();
		var gY = p.get_y();
		while(p.get_parent() != null) {
			p = p.get_parent();
			gX += p.get_x();
			gY += p.get_y();
		}
		var pos = new List();
		pos.add(gX);
		pos.add(gY);
		return pos;
	}
	,pressEnabled: function() {
		var me = this;
		this._dom.onmousedown = function(e) {
			me._clientX = e.clientX;
			me._clientY = e.clientY;
			me.press.dispatch();
		};
	}
	,pressDisabled: function() {
		this._dom.onmousedown = null;
	}
	,releaseEnabled: function() {
		var me = this;
		this._dom.onmouseup = function(e) {
			me._clientX = e.clientX;
			me._clientY = e.clientY;
			me.release.dispatch();
		};
	}
	,releaseDisabled: function() {
		this._dom.onmouseup = null;
	}
	,overEnabled: function() {
		var me = this;
		this._dom.onmouseover = function(e) {
			me.over.dispatch();
		};
	}
	,overDisabled: function() {
		this._dom.onmouseover = null;
	}
	,outEnabled: function() {
		var me = this;
		this._dom.onmouseout = function(e) {
			me.out.dispatch();
		};
	}
	,outDisabled: function() {
		this._dom.onmouseout = null;
	}
	,setupDrag: function() {
		this._style.cursor = "pointer";
		this.press.add(this.startDrag.$bind(this));
		this.release.add(this.stopDrag.$bind(this));
	}
	,startDrag: function() {
		this.offSetX = this._clientX - this.get_x() | 0;
		this.offSetY = this._clientY - this.get_y() | 0;
		divtastic.js.GlobalDiv.ROOT(this).onmousemove = this.drag.$bind(this);
	}
	,stopDrag: function() {
		divtastic.js.GlobalDiv.ROOT(this).onmousemove = null;
	}
	,drag: function(e) {
		if(this.dragInform) this.dragging.dispatch();
		this.set_x(e.clientX - this.offSetX);
		this.set_y(e.clientY - this.offSetY);
	}
	,setupParentDrag: function() {
		var me = this;
		this._style.cursor = "pointer";
		this.press.add(this.parentStartDrag.$bind(this));
		this.release.add(this.parentStopDrag.$bind(this));
	}
	,parentStartDrag: function() {
		this.offSetX = this._clientX - this.get_parent().get_x() | 0;
		this.offSetY = this._clientY - this.get_parent().get_y() | 0;
		divtastic.js.GlobalDiv.ROOT(this).onmousemove = this.parentDrag.$bind(this);
	}
	,parentStopDrag: function() {
		divtastic.js.GlobalDiv.ROOT(this).onmousemove = null;
	}
	,parentDrag: function(e) {
		if(this.dragInform) this.draggingParent.dispatch();
		this.get_parent().set_x(e.clientX - this.offSetX);
		this.get_parent().set_y(e.clientY - this.offSetY);
	}
	,play: function() {
		if(this._vid != null) this._vid.play();
	}
	,isVideo: function(img) {
		if(img == null) return false;
		var arr = img.split(".");
		if(arr.length == null) return false;
		var str = arr[1];
		switch(str) {
		case "ogv":case "mpeg":case "mov":case "mp4":case "webm":
			this.videoType = "video/" + str;
			return true;
		}
		return false;
	}
	,videoType: null
	,setImage: function(img) {
		this._img = img;
		if(this.isIE) this.createImageDivIfNot();
		if(img.split(".").length > 1) {
			if(this.isIE) this.imageDiv.setImage(img); else if(this._vid == null) this._style.backgroundImage = "url(" + img + ")"; else {
				this._dom.setAttribute("src",img);
				this._dom.setAttribute("type",this.videoType);
			}
		} else if(this.isIE) this.imageDiv.setImage(img); else this._dom.className = img;
	}
	,setClip: function() {
		this._style.overflow = "Hidden";
	}
	,tile: null
	,getTile: function() {
		if(this._tile == null) this.setTile(false);
		return this._tile;
	}
	,setTile: function(tile_) {
		this._tile = tile_;
		if(this.isIE) this.createImageDivIfNot();
		if(this._tile) {
			if(this.isIE) this.imageDiv.setTile(true); else this._style.backgroundRepeat = "repeat";
		} else if(this.isIE) this.imageDiv.setTile(false); else this._style.backgroundRepeat = "no-repeat";
		return tile_;
	}
	,createImageDivIfNot: function() {
		if(this.imageDiv == null) {
			this.imageDiv = new divtastic.js.ImageDiv();
			this.imageDiv.set_x(0);
			this.imageDiv.set_y(0);
			this.addChild2(this.imageDiv);
		}
		this.imageDiv.set_width(this.get_width());
		this.imageDiv.set_height(this.get_height());
		return this.imageDiv;
	}
	,getInstance: function() {
		return this._dom;
	}
	,getStyle: function() {
		return this._style;
	}
	,text: null
	,set_text: function(txt) {
		this._dom.innerHTML = "";
		this.set_width(0);
		this.set_height(0);
		if(this.get_parent() != null) this.get_parent().updateSizeBasedOnChild(this);
		this._dom.innerHTML = txt;
		switch( (browserhx.Browser.get_BrowserType())[1] ) {
		case 3:
			this._style.MozUserSelect = "none";
			break;
		case 2:
		case 1:
		case 0:
			this._style.webkitUserSelect = "none";
			break;
		case 5:
		case 4:
			this._style.unselectable = "on";
			break;
		}
		this.set_width(this._width);
		this.set_height(this._height);
		if(this.get_parent() != null) this.get_parent().updateSizeBasedOnChild(this);
		return txt;
	}
	,updateText: function(txt) {
		this._dom.innerHTML = "";
		this.set_width(0);
		this.set_height(0);
		this._dom.innerHTML = txt;
		this._style.width = Std.string(this.fixedTextWidth);
		if(this.fixedTextHeight != null) this._style.height = Std.string(this.fixedTextHeight);
		this._style.overflow = "Hidden";
	}
	,get_text: function() {
		return this._dom.innerHTML;
	}
	,visible: null
	,set_visible: function(val) {
		if(val) this._style.visibility = "visible"; else this._style.visibility = "hidden";
		this.viz = val;
		return this.viz;
	}
	,get_visible: function() {
		if(this.viz == null) this.viz = true;
		return this.viz;
	}
	,fill: null
	,set_fill: function(c) {
		if(this.isIE) {
			this.createImageDivIfNot();
			this.imageDiv.set_fill(c);
		} else this._style.backgroundColor = c;
		this._bgColor = c;
		return c;
	}
	,get_fill: function() {
		return this._bgColor;
	}
	,addChild: function(mc) {
		this._dom.appendChild(mc.getInstance());
		mc.set_parent(this);
		this.updateSizeBasedOnChild(mc);
		mc.appended();
		return mc;
	}
	,addChild2: function(mc) {
		this._dom.appendChild(mc.getInstance());
		mc.set_parent(this);
		this.updateSizeBasedOnChild2(mc);
		mc.appended();
		return mc;
	}
	,appended: function() {
	}
	,_parent: null
	,parent: null
	,set_parent: function(mc) {
		this._parent = mc;
		return mc;
	}
	,get_parent: function() {
		return this._parent;
	}
	,updateSizeBasedOnChild2: function(mc) {
		if(this.get_width() < mc.get_width() + mc.get_x()) this.set_width(mc.get_width() + mc.get_x());
		if(this.get_height() < mc.get_height() + mc.get_y()) this.set_height(mc.get_height() + mc.get_y());
	}
	,updateSizeBasedOnChild: function(mc) {
		if(this.get_width() < mc.get_width() + mc.get_x()) this.set_width(mc.get_width() + mc.get_x());
		if(this.get_height() < mc.get_height() + mc.get_y()) this.set_height(mc.get_height() + mc.get_y());
	}
	,height: null
	,set_height: function(val) {
		this._height = val;
		if(this._twoD == null) this._style.paddingTop = val + "px"; else this._style.paddingTop = "0px";
		return val;
	}
	,get_height: function() {
		if(this._height == null || this._height < this._dom.clientHeight) this._height = this._dom.clientHeight;
		return this._height;
	}
	,width: null
	,set_width: function(val) {
		this._width = val;
		if(this._twoD == null) this._style.paddingLeft = val + "px"; else this._style.paddingLeft = "0px";
		return val;
	}
	,get_width: function() {
		if(this._width == null || this._width < this._dom.clientWidth) this._width = this._dom.clientWidth;
		return this._width;
	}
	,y: null
	,set_y: function(val) {
		this._y = val;
		this._style.top = val + "px";
		return val;
	}
	,get_y: function() {
		return this._y;
	}
	,x: null
	,set_x: function(val) {
		this._x = val;
		this._style.left = val + "px";
		return val;
	}
	,get_x: function() {
		return this._x;
	}
	,_canvas: null
	,_twoD: null
	,twoD: null
	,getTwoD: function() {
		if(this._canvas == null) this._canvas = this._dom;
		if(this._twoD == null) this._twoD = this._canvas.getContext("2d");
		return this._twoD;
	}
	,scale: null
	,get_scale: function() {
		if(this._scale == null) {
			this._scale = 1;
			this._scaleX = 1;
			this._scaleY = 1;
		}
		return this._scale;
	}
	,set_scale: function(scale_) {
		var scaleStr = Std.string(scale_);
		var str = "scale(" + scaleStr + ", " + scaleStr + ")";
		switch( (browserhx.Browser.get_BrowserType())[1] ) {
		case 2:
		case 1:
		case 0:
			this._style.WebkitTransform = str;
			break;
		case 4:
			this._style.OTransform = str;
			break;
		case 3:
			this._style.MozTransform = str;
			break;
		case 5:
			this.affineTrans(scale_,0,0,scale_,0,0);
			break;
		}
		this._scale = scale_;
		this._scaleX = scale_;
		this._scaleY = scale_;
		return this._scale;
	}
	,scaleY: null
	,get_scaleY: function() {
		if(this._scaleY == null) this._scaleY = 1;
		return this._scaleY;
	}
	,set_scaleY: function(scaleY_) {
		switch( (browserhx.Browser.get_BrowserType())[1] ) {
		case 2:
		case 0:
		case 1:
			this._style.WebkitTransform = "scaleY(" + Std.string(scaleY_) + ")";
			break;
		case 4:
			this._style.OTransform = "scaleY(" + Std.string(scaleY_) + ")";
			break;
		case 3:
			this._style.MozTransform = "scaleY(" + Std.string(scaleY_) + ")";
			break;
		case 5:
			this.affineTrans(this.get_scaleX(),0,0,scaleY_,0,0);
			break;
		}
		this._scaleY = scaleY_;
		return this._scaleY;
	}
	,scaleX: null
	,get_scaleX: function() {
		if(this._scaleX == null) this._scaleX = 1;
		return this._scaleX;
	}
	,set_scaleX: function(scaleX_) {
		switch( (browserhx.Browser.get_BrowserType())[1] ) {
		case 2:
		case 1:
		case 0:
			this._style.WebkitTransform = "scaleX(" + Std.string(scaleX_) + ")";
			break;
		case 4:
			this._style.OTransform = "scaleX(" + Std.string(scaleX_) + ")";
			break;
		case 3:
			this._style.MozTransform = "scaleX(" + Std.string(scaleX_) + ")";
			break;
		case 5:
			this.affineTrans(scaleX_,0,0,this.get_scaleY(),0,0);
			break;
		}
		this._scaleX = scaleX_;
		return this._scaleX;
	}
	,affineTrans: function(a,b,c,d,e,f) {
		this.afflines = [a,b,c,d,e,f];
		var mat0 = "matrix( " + Std.string(a) + ", " + Std.string(b) + ", " + Std.string(c) + ", " + Std.string(d) + ", ";
		var matrixFirefox = mat0 + Std.string(e) + "px, " + Std.string(e) + "px ) ";
		var matrixGeneral = mat0 + Std.string(e) + Std.string(e) + " ) ";
		switch( (browserhx.Browser.get_BrowserType())[1] ) {
		case 2:
		case 0:
		case 1:
			this._style.WebkitTransform = matrixGeneral;
			break;
		case 4:
			this._style.OTransform = matrixGeneral;
			break;
		case 3:
			this._style.MozTransform = matrixFirefox;
			break;
		case 5:
			this.affineTransIE(a,b,c,d,e,f);
			break;
		}
	}
	,affineTransIE: function(a,b,c,d,e,f) {
		this._style.filter = "progid:DXImageTransform.Microsoft.Matrix(M11=" + a + ", M21=" + b + ", M12=" + c + ", M22=" + d + ", SizingMethod=\"auto expand\")";
		var w2 = this.get_width() / 2;
		var h2 = this.get_height() / 2;
		this.set_x(Math.round(this.get_x() + e - (Math.abs(a) - 1) * w2 + Math.abs(c) * h2));
		this.set_y(Math.round(this.get_y() + f - Math.abs(b) * w2 + (Math.abs(d) - 1) * h2));
	}
	,rotation: null
	,set_rotation: function(angle) {
		this._rotation = angle;
		this._angle = angle | 0;
		var rad = this._rotation * (Math.PI / 180);
		var cos = Math.cos(rad);
		var sin = Math.sin(rad);
		switch( (browserhx.Browser.get_BrowserType())[1] ) {
		case 2:
		case 1:
		case 0:
			this._style.WebkitTransform = "rotate(" + Std.string(this._angle) + "deg)";
			break;
		case 4:
			this._style.OTransform = "rotate(" + Std.string(this._angle) + "deg)";
			break;
		case 3:
			this._style.MozTransform = "rotate(" + Std.string(this._angle) + "deg)";
			break;
		case 5:
			this.affineTrans(cos,-sin,sin,cos,0,0);
			break;
		}
		return angle;
	}
	,get_rotation: function() {
		if(this._rotation == null) {
			this._rotation = 0;
			this._angle = 0;
		}
		return this._rotation;
	}
	,alpha: null
	,get_alpha: function() {
		if(this._alpha == null) this._alpha = 1;
		return this._alpha;
	}
	,set_alpha: function(alpha_) {
		switch( (browserhx.Browser.get_BrowserType())[1] ) {
		case 3:
		case 4:
		case 2:
		case 0:
		case 1:
			this._style.opacity = alpha_;
			break;
		case 5:
			this._style.filter = "alpha(opacity=" + Std.String(Math.round(alpha_ * 10)) + ")";
			break;
		}
		this._alpha = alpha_;
		return this._alpha;
	}
	,__class__: divtastic.js.DisplayDiv
	,__properties__: {set_alpha:"set_alpha",get_alpha:"get_alpha",set_rotation:"set_rotation",get_rotation:"get_rotation",set_scaleX:"set_scaleX",get_scaleX:"get_scaleX",set_scaleY:"set_scaleY",get_scaleY:"get_scaleY",set_scale:"set_scale",get_scale:"get_scale",get_twoD:"getTwoD",set_x:"set_x",get_x:"get_x",set_y:"set_y",get_y:"get_y",set_width:"set_width",get_width:"get_width",set_height:"set_height",get_height:"get_height",set_parent:"set_parent",get_parent:"get_parent",set_fill:"set_fill",get_fill:"get_fill",set_visible:"set_visible",get_visible:"get_visible",set_text:"set_text",get_text:"get_text",set_tile:"setTile",get_tile:"getTile"}
}
var js = js || {}
js.Lib = $hxClasses["js.Lib"] = function() { }
js.Lib.__name__ = ["js","Lib"];
js.Lib.isIE = null;
js.Lib.isOpera = null;
js.Lib.document = null;
js.Lib.window = null;
js.Lib.alert = function(v) {
	alert(js.Boot.__string_rec(v,""));
}
js.Lib.eval = function(code) {
	return eval(code);
}
js.Lib.setErrorHandler = function(f) {
	js.Lib.onerror = f;
}
js.Lib.prototype = {
	__class__: js.Lib
}
divtastic.js.GlobalDiv = $hxClasses["divtastic.js.GlobalDiv"] = function() { }
divtastic.js.GlobalDiv.__name__ = ["divtastic","js","GlobalDiv"];
divtastic.js.GlobalDiv.ROOT = function(d) {
	return divtastic.js.GlobalDiv._root;
}
divtastic.js.GlobalDiv.addChild = function(d,mc) {
	divtastic.js.GlobalDiv._root.body.appendChild(mc.getInstance());
}
divtastic.js.GlobalDiv.prototype = {
	__class__: divtastic.js.GlobalDiv
}
divtastic.js.ImageDiv = $hxClasses["divtastic.js.ImageDiv"] = function(img) {
	haxe.Log.trace("imageDiv",{ fileName : "ImageDiv.hx", lineNumber : 48, className : "divtastic.js.ImageDiv", methodName : "new"});
	this._dom = divtastic.js.GlobalDiv.ROOT(this).createElement("div");
	this._style = this._dom.style;
	this.setTile(false);
	if(img != null) this.setImage(img);
	this._style.position = "absolute";
	this._d = 0;
};
divtastic.js.ImageDiv.__name__ = ["divtastic","js","ImageDiv"];
divtastic.js.ImageDiv.prototype = {
	fixedTextWidth: null
	,fixedTextHeight: null
	,_d: null
	,_dom: null
	,_y: null
	,_x: null
	,_width: null
	,_height: null
	,_style: null
	,_bgColor: null
	,_img: null
	,_tile: null
	,offSetX: null
	,offSetY: null
	,viz: null
	,_scale: null
	,_scaleY: null
	,_scaleX: null
	,_alpha: null
	,_rotation: null
	,_angle: null
	,afflines: null
	,setImage: function(img) {
		this._img = img;
		if(img.split(".").length > 1) this._style.backgroundImage = "url(" + img + ")"; else this._dom.className = img;
	}
	,appended: function() {
	}
	,setClip: function() {
		this._style.overflow = "Hidden";
	}
	,tile: null
	,getTile: function() {
		if(this._tile == null) this.setTile(false);
		return this._tile;
	}
	,setTile: function(tile_) {
		this._tile = tile_;
		if(this._tile) this._style.backgroundRepeat = "repeat"; else this._style.backgroundRepeat = "no-repeat";
		return tile_;
	}
	,getInstance: function() {
		return this._dom;
	}
	,getStyle: function() {
		return this._style;
	}
	,visible: null
	,set_visible: function(val) {
		if(val) this._style.visibility = "visible"; else this._style.visibility = "hidden";
		this.viz = val;
		return this.viz;
	}
	,get_visible: function() {
		if(this.viz == null) this.viz = true;
		return this.viz;
	}
	,fill: null
	,set_fill: function(c) {
		this._bgColor = c;
		this._style.backgroundColor = c;
		return c;
	}
	,get_fill: function() {
		return this._bgColor;
	}
	,height: null
	,set_height: function(val) {
		this._height = val;
		this._style.paddingTop = val + "px";
		return val;
	}
	,get_height: function() {
		if(this._height == null || this._height < this._dom.clientHeight) this._height = this._dom.clientHeight;
		return this._height;
	}
	,width: null
	,set_width: function(val) {
		this._width = val;
		this._style.paddingLeft = val + "px";
		return val;
	}
	,get_width: function() {
		if(this._width == null || this._width < this._dom.clientWidth) this._width = this._dom.clientWidth;
		return this._width;
	}
	,y: null
	,set_y: function(val) {
		this._y = val;
		this._style.top = val + "px";
		return val;
	}
	,get_y: function() {
		return this._y;
	}
	,x: null
	,set_x: function(val) {
		this._x = val;
		this._style.left = val + "px";
		return val;
	}
	,get_x: function() {
		return this._x;
	}
	,_parent: null
	,parent: null
	,set_parent: function(mc) {
		this._parent = mc;
		return mc;
	}
	,get_parent: function() {
		return this._parent;
	}
	,__class__: divtastic.js.ImageDiv
	,__properties__: {set_parent:"set_parent",get_parent:"get_parent",set_x:"set_x",get_x:"get_x",set_y:"set_y",get_y:"get_y",set_width:"set_width",get_width:"get_width",set_height:"set_height",get_height:"get_height",set_fill:"set_fill",get_fill:"get_fill",set_visible:"set_visible",get_visible:"get_visible",set_tile:"setTile",get_tile:"getTile"}
}
var haxe = haxe || {}
haxe.Log = $hxClasses["haxe.Log"] = function() { }
haxe.Log.__name__ = ["haxe","Log"];
haxe.Log.trace = function(v,infos) {
	js.Boot.__trace(v,infos);
}
haxe.Log.clear = function() {
	js.Boot.__clear_trace();
}
haxe.Log.prototype = {
	__class__: haxe.Log
}
haxe.Timer = $hxClasses["haxe.Timer"] = function(time_ms) {
	var me = this;
	this.id = window.setInterval(function() {
		me.run();
	},time_ms);
};
haxe.Timer.__name__ = ["haxe","Timer"];
haxe.Timer.delay = function(f,time_ms) {
	var t = new haxe.Timer(time_ms);
	t.run = function() {
		t.stop();
		f();
	};
	return t;
}
haxe.Timer.measure = function(f,pos) {
	var t0 = haxe.Timer.stamp();
	var r = f();
	haxe.Log.trace(haxe.Timer.stamp() - t0 + "s",pos);
	return r;
}
haxe.Timer.stamp = function() {
	return Date.now().getTime() / 1000;
}
haxe.Timer.prototype = {
	id: null
	,stop: function() {
		if(this.id == null) return;
		window.clearInterval(this.id);
		this.id = null;
	}
	,run: function() {
	}
	,__class__: haxe.Timer
}
var jigsawx = jigsawx || {}
jigsawx.JigsawMagicNumbers = $hxClasses["jigsawx.JigsawMagicNumbers"] = function() { }
jigsawx.JigsawMagicNumbers.__name__ = ["jigsawx","JigsawMagicNumbers"];
jigsawx.JigsawMagicNumbers.prototype = {
	__class__: jigsawx.JigsawMagicNumbers
}
jigsawx.Compass = $hxClasses["jigsawx.Compass"] = { __ename__ : ["jigsawx","Compass"], __constructs__ : ["NORTH","SOUTH","EAST","WEST"] }
jigsawx.Compass.NORTH = ["NORTH",0];
jigsawx.Compass.NORTH.toString = $estr;
jigsawx.Compass.NORTH.__enum__ = jigsawx.Compass;
jigsawx.Compass.SOUTH = ["SOUTH",1];
jigsawx.Compass.SOUTH.toString = $estr;
jigsawx.Compass.SOUTH.__enum__ = jigsawx.Compass;
jigsawx.Compass.EAST = ["EAST",2];
jigsawx.Compass.EAST.toString = $estr;
jigsawx.Compass.EAST.__enum__ = jigsawx.Compass;
jigsawx.Compass.WEST = ["WEST",3];
jigsawx.Compass.WEST.toString = $estr;
jigsawx.Compass.WEST.__enum__ = jigsawx.Compass;
jigsawx.JigsawPiece = $hxClasses["jigsawx.JigsawPiece"] = function(xy_,row,col,lt,rt,rb,lb,sideData_) {
	this.enabled = true;
	this.xy = new jigsawx.math.Vec2(xy_.x,xy_.y);
	this.sideData = sideData_;
	this.points = [];
	this.stepAngle = 10 * Math.PI / 180;
	this.first = lt;
	if(this.sideData.north != null) this.createVertSide(lt,rt,this.sideData.north,jigsawx.Compass.NORTH);
	this.points.push(rt);
	if(this.sideData.east != null) this.createHoriSide(rt,rb,this.sideData.east,jigsawx.Compass.EAST);
	this.points.push(rb);
	if(this.sideData.south != null) this.createVertSide(rb,lb,this.sideData.south,jigsawx.Compass.SOUTH);
	this.points.push(lb);
	if(this.sideData.west != null) this.createHoriSide(lb,lt,this.sideData.west,jigsawx.Compass.WEST);
	this.points.push(lt);
};
jigsawx.JigsawPiece.__name__ = ["jigsawx","JigsawPiece"];
jigsawx.JigsawPiece.prototype = {
	enabled: null
	,curveBuilder: null
	,stepAngle: null
	,centre: null
	,points: null
	,sideData: null
	,first: null
	,xy: null
	,row: null
	,col: null
	,getPoints: function() {
		return this.points;
	}
	,getFirst: function() {
		return this.first;
	}
	,createVertSide: function(A,B,side,compass) {
		this.drawSide(A.x + (B.x - A.x) / 2 + 6. - side.squew * 12,A.y + (B.y - A.y) / 2 + 2.5 - side.inout * 5,side,compass);
	}
	,createHoriSide: function(A,B,side,compass) {
		this.drawSide(A.x + (B.x - A.x) / 2 + 2.5 - side.inout * 5,A.y + (B.y - A.y) / 2 + 6. - side.squew * 12,side,compass);
	}
	,drawSide: function(dx,dy,sideData,compass) {
		var halfPI = Math.PI / 2;
		var dimensions = new jigsawx.math.Vec2();
		var offsetCentre = new jigsawx.math.Vec2();
		var bubble = sideData.bubble;
		this.centre = (function($this) {
			var $r;
			switch( (compass)[1] ) {
			case 0:
				$r = new jigsawx.math.Vec2(dx,dy + 6 * (function($this) {
					var $r;
					switch( (bubble)[1] ) {
					case 0:
						$r = 1;
						break;
					case 1:
						$r = -1;
						break;
					}
					return $r;
				}($this)));
				break;
			case 2:
				$r = new jigsawx.math.Vec2(dx - 6 * (function($this) {
					var $r;
					switch( (bubble)[1] ) {
					case 0:
						$r = 1;
						break;
					case 1:
						$r = -1;
						break;
					}
					return $r;
				}($this)),dy);
				break;
			case 1:
				$r = new jigsawx.math.Vec2(dx,dy - 6 * (function($this) {
					var $r;
					switch( (bubble)[1] ) {
					case 0:
						$r = 1;
						break;
					case 1:
						$r = -1;
						break;
					}
					return $r;
				}($this)));
				break;
			case 3:
				$r = new jigsawx.math.Vec2(dx + 6 * (function($this) {
					var $r;
					switch( (bubble)[1] ) {
					case 0:
						$r = 1;
						break;
					case 1:
						$r = -1;
						break;
					}
					return $r;
				}($this)),dy);
				break;
			}
			return $r;
		}(this));
		this.curveBuilder = new jigsawx.OpenEllipse();
		this.curveBuilder.centre = this.centre;
		dimensions.x = (1 + (0.5 - sideData.centreWide) / 2) * 5.625;
		dimensions.y = (1 + (0.5 - sideData.centreHi) / 2) * 5.625;
		this.curveBuilder.dimensions = dimensions;
		this.curveBuilder.beginAngle = Math.PI / 8;
		this.curveBuilder.finishAngle = -Math.PI / 8;
		this.curveBuilder.stepAngle = this.stepAngle;
		this.curveBuilder.rotation = (function($this) {
			var $r;
			switch( (bubble)[1] ) {
			case 0:
				$r = 0;
				break;
			case 1:
				$r = Math.PI;
				break;
			}
			return $r;
		}(this));
		switch( (compass)[1] ) {
		case 0:
			break;
		case 2:
			this.curveBuilder.rotation += halfPI;
			break;
		case 1:
			this.curveBuilder.rotation += Math.PI;
			break;
		case 3:
			this.curveBuilder.rotation += 3 * halfPI;
			break;
		}
		var secondPoints = this.curveBuilder.getRenderList();
		if(bubble == jigsawx.Bubble.IN) secondPoints.reverse();
		var theta = this.curveBuilder.beginAngle - this.curveBuilder.finishAngle + Math.PI;
		var cosTheta = Math.cos(theta);
		var sinTheta = Math.sin(theta);
		var hyp = this.curveBuilder.getBeginRadius();
		dimensions.x = (1 + (0.5 - sideData.leftWide) / 2) * 3.;
		dimensions.y = (1 + (0.5 - sideData.leftHi) / 2) * (11 / 6);
		this.curveBuilder.dimensions = dimensions;
		this.curveBuilder.beginAngle = halfPI;
		this.curveBuilder.finishAngle = -halfPI;
		this.curveBuilder.stepAngle = this.stepAngle;
		this.curveBuilder.rotation = theta + (function($this) {
			var $r;
			switch( (bubble)[1] ) {
			case 0:
				$r = 0;
				break;
			case 1:
				$r = halfPI;
				break;
			}
			return $r;
		}(this));
		switch( (compass)[1] ) {
		case 0:
			break;
		case 2:
			this.curveBuilder.rotation += halfPI;
			break;
		case 1:
			this.curveBuilder.rotation += Math.PI;
			break;
		case 3:
			this.curveBuilder.rotation += 3 * halfPI;
			break;
		}
		var hypLeft = hyp + this.curveBuilder.dimensions.x;
		switch( (compass)[1] ) {
		case 0:
			offsetCentre.x = this.centre.x + hypLeft * cosTheta;
			offsetCentre.y = this.centre.y + (function($this) {
				var $r;
				switch( (bubble)[1] ) {
				case 0:
					$r = hypLeft * sinTheta;
					break;
				case 1:
					$r = -hypLeft * sinTheta;
					break;
				}
				return $r;
			}(this));
			break;
		case 2:
			offsetCentre.x = this.centre.x + (function($this) {
				var $r;
				switch( (bubble)[1] ) {
				case 0:
					$r = -hypLeft * cosTheta;
					break;
				case 1:
					$r = hypLeft * cosTheta;
					break;
				}
				return $r;
			}(this));
			offsetCentre.y = this.centre.y + hypLeft * sinTheta;
			break;
		case 1:
			offsetCentre.x = this.centre.x - hypLeft * cosTheta;
			offsetCentre.y = this.centre.y - (function($this) {
				var $r;
				switch( (bubble)[1] ) {
				case 0:
					$r = hypLeft * sinTheta;
					break;
				case 1:
					$r = -hypLeft * sinTheta;
					break;
				}
				return $r;
			}(this));
			break;
		case 3:
			offsetCentre.x = this.centre.x + (function($this) {
				var $r;
				switch( (bubble)[1] ) {
				case 0:
					$r = hypLeft * cosTheta;
					break;
				case 1:
					$r = -hypLeft * cosTheta;
					break;
				}
				return $r;
			}(this));
			offsetCentre.y = this.centre.y - hypLeft * sinTheta;
			break;
		}
		this.curveBuilder.centre = offsetCentre;
		var startPoint = this.curveBuilder.getBegin();
		var firstPoints = this.curveBuilder.getRenderList();
		if(sideData.bubble == jigsawx.Bubble.OUT) firstPoints.reverse();
		this.points = this.points.concat(firstPoints.concat(secondPoints));
		dimensions.x = (1 + (0.5 - sideData.rightWide) / 2) * 3.;
		dimensions.y = (1 + (0.5 - sideData.rightHi) / 2) * (11 / 6);
		this.curveBuilder.dimensions = dimensions;
		this.curveBuilder.beginAngle = halfPI;
		this.curveBuilder.finishAngle = -halfPI;
		this.curveBuilder.stepAngle = this.stepAngle;
		this.curveBuilder.rotation = theta + (function($this) {
			var $r;
			switch( (bubble)[1] ) {
			case 0:
				$r = -halfPI;
				break;
			case 1:
				$r = Math.PI;
				break;
			}
			return $r;
		}(this));
		switch( (compass)[1] ) {
		case 0:
			break;
		case 2:
			this.curveBuilder.rotation += halfPI;
			break;
		case 1:
			this.curveBuilder.rotation += Math.PI;
			break;
		case 3:
			this.curveBuilder.rotation += 3 * halfPI;
			break;
		}
		var hypRight = hyp + this.curveBuilder.dimensions.x;
		switch( (compass)[1] ) {
		case 0:
			offsetCentre.x = this.centre.x - hypRight * cosTheta;
			offsetCentre.y = this.centre.y + (function($this) {
				var $r;
				switch( (bubble)[1] ) {
				case 0:
					$r = hypRight * sinTheta;
					break;
				case 1:
					$r = -hypRight * sinTheta;
					break;
				}
				return $r;
			}(this));
			break;
		case 2:
			offsetCentre.x = this.centre.x + (function($this) {
				var $r;
				switch( (bubble)[1] ) {
				case 0:
					$r = -hypLeft * cosTheta;
					break;
				case 1:
					$r = hypLeft * cosTheta;
					break;
				}
				return $r;
			}(this));
			offsetCentre.y = this.centre.y - hypLeft * sinTheta;
			break;
		case 1:
			offsetCentre.x = this.centre.x + hypRight * cosTheta;
			offsetCentre.y = this.centre.y - (function($this) {
				var $r;
				switch( (bubble)[1] ) {
				case 0:
					$r = hypRight * sinTheta;
					break;
				case 1:
					$r = -hypRight * sinTheta;
					break;
				}
				return $r;
			}(this));
			break;
		case 3:
			offsetCentre.x = this.centre.x + (function($this) {
				var $r;
				switch( (bubble)[1] ) {
				case 0:
					$r = hypLeft * cosTheta;
					break;
				case 1:
					$r = -hypLeft * cosTheta;
					break;
				}
				return $r;
			}(this));
			offsetCentre.y = this.centre.y + hypLeft * sinTheta;
			break;
		}
		this.curveBuilder.centre = offsetCentre;
		var thirdPoints = this.curveBuilder.getRenderList();
		if(bubble == jigsawx.Bubble.OUT) thirdPoints.reverse();
		this.points = this.points.concat(thirdPoints);
	}
	,__class__: jigsawx.JigsawPiece
}
jigsawx.Bubble = $hxClasses["jigsawx.Bubble"] = { __ename__ : ["jigsawx","Bubble"], __constructs__ : ["IN","OUT"] }
jigsawx.Bubble.IN = ["IN",0];
jigsawx.Bubble.IN.toString = $estr;
jigsawx.Bubble.IN.__enum__ = jigsawx.Bubble;
jigsawx.Bubble.OUT = ["OUT",1];
jigsawx.Bubble.OUT.toString = $estr;
jigsawx.Bubble.OUT.__enum__ = jigsawx.Bubble;
jigsawx.JigsawSideData = $hxClasses["jigsawx.JigsawSideData"] = function() {
};
jigsawx.JigsawSideData.__name__ = ["jigsawx","JigsawSideData"];
jigsawx.JigsawSideData.halfPieceData = function() {
	return { north : null, east : jigsawx.JigsawSideData.create(), south : jigsawx.JigsawSideData.create(), west : null};
}
jigsawx.JigsawSideData.createBubble = function() {
	return Math.round(Math.random()) == 1?jigsawx.Bubble.IN:jigsawx.Bubble.OUT;
}
jigsawx.JigsawSideData.swapBubble = function(bubble) {
	if(bubble == jigsawx.Bubble.OUT) return jigsawx.Bubble.IN;
	if(bubble == jigsawx.Bubble.IN) return jigsawx.Bubble.OUT;
	return null;
}
jigsawx.JigsawSideData.reflect = function(j) {
	var side = new jigsawx.JigsawSideData();
	side.bubble = jigsawx.JigsawSideData.swapBubble(j.bubble);
	side.squew = j.squew;
	side.inout = j.inout;
	side.leftWide = j.rightWide;
	side.leftHi = j.rightHi;
	side.centreWide = j.centreWide;
	side.centreHi = j.centreHi;
	side.rightWide = j.leftWide;
	side.rightHi = j.leftHi;
	return side;
}
jigsawx.JigsawSideData.createSimple = function() {
	var side = new jigsawx.JigsawSideData();
	side.bubble = jigsawx.JigsawSideData.createBubble();
	side.squew = 0.5;
	side.inout = 0.5;
	side.leftWide = 0.5;
	side.leftHi = 0.5;
	side.centreWide = 0.5;
	side.centreHi = 0.5;
	side.rightWide = 0.5;
	side.rightHi = 0.5;
	return side;
}
jigsawx.JigsawSideData.create = function() {
	var side = new jigsawx.JigsawSideData();
	side.bubble = jigsawx.JigsawSideData.createBubble();
	side.squew = Math.random();
	side.inout = Math.random();
	side.leftWide = Math.random();
	side.leftHi = Math.random();
	side.centreWide = Math.random();
	side.centreHi = Math.random();
	side.rightWide = Math.random();
	side.rightHi = Math.random();
	return side;
}
jigsawx.JigsawSideData.prototype = {
	bubble: null
	,squew: null
	,inout: null
	,leftWide: null
	,leftHi: null
	,centreWide: null
	,centreHi: null
	,rightWide: null
	,rightHi: null
	,__class__: jigsawx.JigsawSideData
}
jigsawx.Jigsawx = $hxClasses["jigsawx.Jigsawx"] = function(dx_,dy_,rows_,cols_) {
	this.pieces = [];
	this.jigs = [];
	this.sides = [];
	this.dx = dx_;
	this.dy = dy_;
	this.rows = rows_;
	this.cols = cols_;
	var xy = new jigsawx.math.Vec2(20,20);
	var lt = new jigsawx.math.Vec2(20,20);
	var rt = new jigsawx.math.Vec2(20 + this.dx,20);
	var rb = new jigsawx.math.Vec2(20 + this.dx,this.dy + 20);
	var lb = new jigsawx.math.Vec2(20,this.dy + 20);
	this.length = 0;
	var last;
	var _g1 = 0, _g = this.rows;
	while(_g1 < _g) {
		var row = _g1++;
		last = { north : null, east : null, south : null, west : null};
		this.sides.push(new Array());
		var _g3 = 0, _g2 = this.cols;
		while(_g3 < _g2) {
			var col = _g3++;
			var jigsawPiece = jigsawx.JigsawSideData.halfPieceData();
			if(last.east != null) jigsawPiece.west = jigsawx.JigsawSideData.reflect(last.east);
			if(col == this.cols - 1) jigsawPiece.east = null;
			this.sides[row][col] = jigsawPiece;
			last = jigsawPiece;
			this.length++;
		}
	}
	var _g1 = 0, _g = this.cols;
	while(_g1 < _g) {
		var col = _g1++;
		last = { north : null, east : null, south : null, west : null};
		var _g3 = 0, _g2 = this.rows;
		while(_g3 < _g2) {
			var row = _g3++;
			var jigsawPiece = this.sides[row][col];
			if(last.south != null) jigsawPiece.north = jigsawx.JigsawSideData.reflect(last.south);
			if(row == this.rows - 1) jigsawPiece.south = null;
			last = jigsawPiece;
		}
	}
	var jig;
	var _g1 = 0, _g = this.rows;
	while(_g1 < _g) {
		var row = _g1++;
		this.pieces.push(new Array());
		var _g3 = 0, _g2 = this.cols;
		while(_g3 < _g2) {
			var col = _g3++;
			jig = new jigsawx.JigsawPiece(xy,row,col,lt,rt,rb,lb,this.sides[row][col]);
			this.pieces[row][col] = jig;
			this.jigs.push(jig);
			xy.x += this.dx;
		}
		xy.x = 20;
		xy.y += this.dy;
	}
};
jigsawx.Jigsawx.__name__ = ["jigsawx","Jigsawx"];
jigsawx.Jigsawx.prototype = {
	rows: null
	,cols: null
	,pieces: null
	,jigs: null
	,sides: null
	,lt: null
	,rt: null
	,rb: null
	,lb: null
	,dx: null
	,dy: null
	,length: null
	,__class__: jigsawx.Jigsawx
}
jigsawx.OpenEllipse = $hxClasses["jigsawx.OpenEllipse"] = function() {
};
jigsawx.OpenEllipse.__name__ = ["jigsawx","OpenEllipse"];
jigsawx.OpenEllipse.prototype = {
	rotation: null
	,beginAngle: null
	,finishAngle: null
	,stepAngle: null
	,centre: null
	,dimensions: null
	,circleIter: null
	,_points: null
	,getBegin: function() {
		return this.createPoint(this.centre,this.dimensions,this.beginAngle);
	}
	,getFinish: function() {
		return this.createPoint(this.centre,this.dimensions,this.finishAngle);
	}
	,getBeginRadius: function() {
		return this.pointDistance(this.centre,this.getBegin());
	}
	,getFinishRadius: function() {
		return this.pointDistance(this.centre,this.getFinish());
	}
	,pointDistance: function(A,B) {
		var dx = A.x - B.x;
		var dy = A.y - B.y;
		return Math.sqrt(dx * dx + dy * dy);
	}
	,setUp: function() {
		this.circleIter = jigsawx.ds.CircleIter.pi2pi(this.beginAngle,this.finishAngle,this.stepAngle);
	}
	,getRenderList: function() {
		this._points = new Array();
		if(this.circleIter == null) this.setUp();
		this._points.push(this.createPoint(this.centre,this.dimensions,this.beginAngle));
		var $it0 = jigsawx.ds.CircleIter.pi2pi(this.beginAngle,this.finishAngle,this.stepAngle).reset();
		while( $it0.hasNext() ) {
			var theta = $it0.next();
			this._points.push(this.createPoint(this.centre,this.dimensions,theta));
		}
		return this._points;
	}
	,createPoint: function(centre,dimensions,theta) {
		var offSetA = 3 * Math.PI / 2 - this.rotation;
		var dx = dimensions.x * Math.sin(theta);
		var dy = -dimensions.y * Math.cos(theta);
		var dxNew = centre.x - dx * Math.sin(offSetA) + dy * Math.cos(offSetA);
		var dyNew = centre.y - dx * Math.cos(offSetA) - dy * Math.sin(offSetA);
		return new jigsawx.math.Vec2(dxNew,dyNew);
	}
	,__class__: jigsawx.OpenEllipse
}
if(!jigsawx.ds) jigsawx.ds = {}
jigsawx.ds.Sign = $hxClasses["jigsawx.ds.Sign"] = { __ename__ : ["jigsawx","ds","Sign"], __constructs__ : ["UP","DOWN"] }
jigsawx.ds.Sign.UP = ["UP",0];
jigsawx.ds.Sign.UP.toString = $estr;
jigsawx.ds.Sign.UP.__enum__ = jigsawx.ds.Sign;
jigsawx.ds.Sign.DOWN = ["DOWN",1];
jigsawx.ds.Sign.DOWN.toString = $estr;
jigsawx.ds.Sign.DOWN.__enum__ = jigsawx.ds.Sign;
jigsawx.ds.CircleIter = $hxClasses["jigsawx.ds.CircleIter"] = function(begin_,fin_,step_,min_,max_) {
	this.begin = begin_;
	this.current = this.begin;
	this.fin = fin_;
	this.step = step_;
	this.min = min_;
	this.max = max_;
	this.onDirection = this.step > 0?jigsawx.ds.Sign.UP:jigsawx.ds.Sign.DOWN;
};
jigsawx.ds.CircleIter.__name__ = ["jigsawx","ds","CircleIter"];
jigsawx.ds.CircleIter.pi2 = function(begin_,fin_,step_) {
	return new jigsawx.ds.CircleIter(begin_,fin_,step_,0,2 * Math.PI);
}
jigsawx.ds.CircleIter.pi2pi = function(begin_,fin_,step_) {
	return new jigsawx.ds.CircleIter(begin_,fin_,step_,-Math.PI,Math.PI);
}
jigsawx.ds.CircleIter.prototype = {
	begin: null
	,fin: null
	,step: null
	,min: null
	,max: null
	,current: null
	,onDirection: null
	,reset: function() {
		this.current = this.begin;
		return this;
	}
	,hasNext: function() {
		switch( (this.onDirection)[1] ) {
		case 0:
			return this.current < this.fin && this.current + this.step > this.fin || this.current == this.fin?false:true;
		case 1:
			return this.current > this.fin && this.current - this.step < this.fin || this.current == this.fin?false:true;
		}
	}
	,next: function() {
		this.current += this.step;
		switch( (this.onDirection)[1] ) {
		case 0:
			if(this.current > this.max) this.current = this.min + this.current - this.max;
			break;
		case 1:
			if(this.current < this.min) this.current = this.max + this.current - this.min;
			break;
		}
		if(!this.hasNext()) return this.fin;
		return this.current;
	}
	,__class__: jigsawx.ds.CircleIter
}
if(!jigsawx.examples) jigsawx.examples = {}
jigsawx.examples.JigsawDivtastic = $hxClasses["jigsawx.examples.JigsawDivtastic"] = function() {
	this.holder = new divtastic.js.DisplayDiv();
	this.holder.set_x(0);
	this.holder.set_y(0);
	this.holder.set_width(800);
	this.holder.set_height(600);
	this.count = 0;
	divtastic.js.GlobalDiv.addChild(this,this.holder);
	this.createVisuals();
	this.createHit();
	this.videoDisplay();
};
jigsawx.examples.JigsawDivtastic.__name__ = ["jigsawx","examples","JigsawDivtastic"];
jigsawx.examples.JigsawDivtastic.main = function() {
	new jigsawx.examples.JigsawDivtastic();
}
jigsawx.examples.JigsawDivtastic.prototype = {
	holder: null
	,hit: null
	,jigsawx: null
	,videoSource: null
	,wid: null
	,hi: null
	,rows: null
	,cols: null
	,count: null
	,atimer: null
	,depth: null
	,tiles: null
	,surfaces: null
	,createHit: function() {
		this.hit = new divtastic.js.DisplayDiv();
		this.hit.set_x(0);
		this.hit.set_y(0);
		this.hit.set_width(1000);
		this.hit.set_height(1000);
		this.hit.getStyle().cursor = "pointer";
		this.hit.getStyle().zIndex = 1000000000;
		divtastic.js.GlobalDiv.addChild(this,this.hit);
		this.hit.press.add(this.checkForDrag.$bind(this));
	}
	,checkForDrag: function() {
		var me = this;
		divtastic.js.GlobalDiv.ROOT(this).onmousemove = null;
		var pos = this.hit.getGlobalMouseXY();
		var px = pos.first();
		var py = pos.last();
		var distance = 1000000000.;
		var closest = this.tiles[0];
		var jig = this.jigsawx.jigs[0];
		var surface = this.surfaces[0];
		var dx;
		var dy;
		var dr2;
		var vXY;
		var _g1 = 0, _g = this.tiles.length;
		while(_g1 < _g) {
			var i = _g1++;
			if(this.jigsawx.jigs[i].enabled) {
				dx = this.tiles[i].get_x() - px;
				dy = this.tiles[i].get_y() - py;
				dr2 = dx * dx + dy * dy;
				if(dr2 < distance) {
					closest = this.tiles[i];
					jig = this.jigsawx.jigs[i];
					surface = this.surfaces[i];
					distance = dr2;
				}
			}
		}
		var wid_ = this.wid / 2;
		var hi_ = this.hi / 2;
		if(distance < this.wid * this.hi) {
			closest.getStyle().zIndex = this.depth++;
			divtastic.js.GlobalDiv.ROOT(this).onmouseup = function(e) {
				closest.set_x(e.clientX - wid_ / 2);
				closest.set_y(e.clientY - hi_ / 2);
				if(Math.abs(jig.xy.x - closest.get_x()) < (wid_ + hi_) / 4 && Math.abs(jig.xy.y - closest.get_y()) < (wid_ + hi_) / 4) {
					closest.set_x(jig.xy.x);
					closest.set_y(jig.xy.y);
					closest.set_alpha(1);
					jig.enabled = false;
				}
				divtastic.js.GlobalDiv.ROOT(me).onmousemove = null;
			};
			divtastic.js.GlobalDiv.ROOT(this).onmousemove = function(e) {
				closest.set_x(e.clientX - wid_ / 2);
				closest.set_y(e.clientY - hi_ / 2);
			};
		}
	}
	,drawEdge: function(surface,jig,c) {
		surface.strokeStyle = c;
		surface.lineWidth = 2;
		surface.beginPath();
		var first = jig.getFirst();
		surface.moveTo(first.x,first.y);
		var _g = 0, _g1 = jig.getPoints();
		while(_g < _g1.length) {
			var v = _g1[_g];
			++_g;
			surface.lineTo(v.x,v.y);
		}
		surface.stroke();
		surface.closePath();
		surface.clip();
	}
	,videoDisplay: function() {
		this.videoSource = new divtastic.js.DisplayDiv("big_buck_bunny.webm");
		this.videoSource.set_x(0);
		this.videoSource.set_y(0);
		this.videoSource.set_width(10);
		this.videoSource.set_height(10);
		this.videoSource.play();
		this.videoSource.getStyle().position = "absolute";
		this.atimer = new haxe.Timer(40);
		this.atimer.run = this.copyAcross.$bind(this);
	}
	,createVisuals: function() {
		var sp;
		var canvasSp;
		var surface;
		var first;
		this.surfaces = [];
		this.tiles = [];
		this.rows = 6;
		this.cols = 10;
		this.wid = 50;
		this.hi = 50;
		this.jigsawx = new jigsawx.Jigsawx(50,50,this.rows,this.cols);
		this.depth = 0;
		var _g = 0, _g1 = this.jigsawx.jigs;
		while(_g < _g1.length) {
			var jig = _g1[_g];
			++_g;
			sp = new divtastic.js.DisplayDiv();
			this.holder.addChild(sp);
			this.tiles.push(sp);
			sp.set_x(jig.xy.x);
			sp.set_y(jig.xy.y);
			sp.set_width(0);
			sp.set_height(0);
			canvasSp = new divtastic.js.DisplayDiv("canvas");
			canvasSp.set_x(-this.wid / 2 + 5);
			canvasSp.set_y(-this.hi / 2 + 5);
			surface = canvasSp.getTwoD();
			sp.getStyle().zIndex = this.depth++;
			sp.addChild(canvasSp);
			if(Math.random() * 5 > 2) {
				sp.set_x(1000 - Math.random() * 400);
				sp.set_y(300 - Math.random() * 300);
				sp.set_alpha(0.7);
				this.drawEdge(surface,jig,"blue");
			} else {
				jig.enabled = false;
				this.drawEdge(surface,jig,"black");
			}
			this.surfaces.push(surface);
		}
	}
	,copyAcross: function() {
		this.count++;
		var xy = new jigsawx.math.Vec2(20,20);
		var image = this.videoSource.getInstance();
		var count = 0;
		var _g1 = 0, _g = this.rows;
		while(_g1 < _g) {
			var row = _g1++;
			var _g3 = 0, _g2 = this.cols;
			while(_g3 < _g2) {
				var col = _g3++;
				this.surfaces[count].drawImage(image,-xy.x,-xy.y);
				xy.x += this.wid;
				count++;
			}
			xy.x = 20;
			xy.y += this.hi;
		}
	}
	,__class__: jigsawx.examples.JigsawDivtastic
}
if(!jigsawx.math) jigsawx.math = {}
jigsawx.math.Vec2 = $hxClasses["jigsawx.math.Vec2"] = function(x_,y_) {
	if(y_ == null) y_ = .0;
	if(x_ == null) x_ = .0;
	this.x = x_;
	this.y = y_;
};
jigsawx.math.Vec2.__name__ = ["jigsawx","math","Vec2"];
jigsawx.math.Vec2.prototype = {
	x: null
	,y: null
	,__class__: jigsawx.math.Vec2
}
js.Boot = $hxClasses["js.Boot"] = function() { }
js.Boot.__name__ = ["js","Boot"];
js.Boot.__unhtml = function(s) {
	return s.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;");
}
js.Boot.__trace = function(v,i) {
	var msg = i != null?i.fileName + ":" + i.lineNumber + ": ":"";
	msg += js.Boot.__string_rec(v,"");
	var d = document.getElementById("haxe:trace");
	if(d != null) d.innerHTML += js.Boot.__unhtml(msg) + "<br/>"; else if(typeof(console) != "undefined" && console.log != null) console.log(msg);
}
js.Boot.__clear_trace = function() {
	var d = document.getElementById("haxe:trace");
	if(d != null) d.innerHTML = "";
}
js.Boot.__string_rec = function(o,s) {
	if(o == null) return "null";
	if(s.length >= 5) return "<...>";
	var t = typeof(o);
	if(t == "function" && (o.__name__ != null || o.__ename__ != null)) t = "object";
	switch(t) {
	case "object":
		if(o instanceof Array) {
			if(o.__enum__ != null) {
				if(o.length == 2) return o[0];
				var str = o[0] + "(";
				s += "\t";
				var _g1 = 2, _g = o.length;
				while(_g1 < _g) {
					var i = _g1++;
					if(i != 2) str += "," + js.Boot.__string_rec(o[i],s); else str += js.Boot.__string_rec(o[i],s);
				}
				return str + ")";
			}
			var l = o.length;
			var i;
			var str = "[";
			s += "\t";
			var _g = 0;
			while(_g < l) {
				var i1 = _g++;
				str += (i1 > 0?",":"") + js.Boot.__string_rec(o[i1],s);
			}
			str += "]";
			return str;
		}
		var tostr;
		try {
			tostr = o.toString;
		} catch( e ) {
			return "???";
		}
		if(tostr != null && tostr != Object.toString) {
			var s2 = o.toString();
			if(s2 != "[object Object]") return s2;
		}
		var k = null;
		var str = "{\n";
		s += "\t";
		var hasp = o.hasOwnProperty != null;
		for( var k in o ) { ;
		if(hasp && !o.hasOwnProperty(k)) {
			continue;
		}
		if(k == "prototype" || k == "__class__" || k == "__super__" || k == "__interfaces__" || k == "__properties__") {
			continue;
		}
		if(str.length != 2) str += ", \n";
		str += s + k + " : " + js.Boot.__string_rec(o[k],s);
		}
		s = s.substring(1);
		str += "\n" + s + "}";
		return str;
	case "function":
		return "<function>";
	case "string":
		return o;
	default:
		return String(o);
	}
}
js.Boot.__interfLoop = function(cc,cl) {
	if(cc == null) return false;
	if(cc == cl) return true;
	var intf = cc.__interfaces__;
	if(intf != null) {
		var _g1 = 0, _g = intf.length;
		while(_g1 < _g) {
			var i = _g1++;
			var i1 = intf[i];
			if(i1 == cl || js.Boot.__interfLoop(i1,cl)) return true;
		}
	}
	return js.Boot.__interfLoop(cc.__super__,cl);
}
js.Boot.__instanceof = function(o,cl) {
	try {
		if(o instanceof cl) {
			if(cl == Array) return o.__enum__ == null;
			return true;
		}
		if(js.Boot.__interfLoop(o.__class__,cl)) return true;
	} catch( e ) {
		if(cl == null) return false;
	}
	switch(cl) {
	case Int:
		return Math.ceil(o%2147483648.0) === o;
	case Float:
		return typeof(o) == "number";
	case Bool:
		return o === true || o === false;
	case String:
		return typeof(o) == "string";
	case Dynamic:
		return true;
	default:
		if(o == null) return false;
		return o.__enum__ == cl || cl == Class && o.__name__ != null || cl == Enum && o.__ename__ != null;
	}
}
js.Boot.__init = function() {
	js.Lib.isIE = typeof document!='undefined' && document.all != null && typeof window!='undefined' && window.opera == null;
	js.Lib.isOpera = typeof window!='undefined' && window.opera != null;
	Array.prototype.copy = Array.prototype.slice;
	Array.prototype.insert = function(i,x) {
		this.splice(i,0,x);
	};
	Array.prototype.remove = Array.prototype.indexOf?function(obj) {
		var idx = this.indexOf(obj);
		if(idx == -1) return false;
		this.splice(idx,1);
		return true;
	}:function(obj) {
		var i = 0;
		var l = this.length;
		while(i < l) {
			if(this[i] == obj) {
				this.splice(i,1);
				return true;
			}
			i++;
		}
		return false;
	};
	Array.prototype.iterator = function() {
		return { cur : 0, arr : this, hasNext : function() {
			return this.cur < this.arr.length;
		}, next : function() {
			return this.arr[this.cur++];
		}};
	};
	if(String.prototype.cca == null) String.prototype.cca = String.prototype.charCodeAt;
	String.prototype.charCodeAt = function(i) {
		var x = this.cca(i);
		if(x != x) return undefined;
		return x;
	};
	var oldsub = String.prototype.substr;
	String.prototype.substr = function(pos,len) {
		if(pos != null && pos != 0 && len != null && len < 0) return "";
		if(len == null) len = this.length;
		if(pos < 0) {
			pos = this.length + pos;
			if(pos < 0) pos = 0;
		} else if(len < 0) len = this.length + len - pos;
		return oldsub.apply(this,[pos,len]);
	};
	Function.prototype["$bind"] = function(o) {
		var f = function() {
			return f.method.apply(f.scope,arguments);
		};
		f.scope = o;
		f.method = this;
		return f;
	};
}
js.Boot.prototype = {
	__class__: js.Boot
}
var zpartanlite = zpartanlite || {}
zpartanlite.DispatchTo = $hxClasses["zpartanlite.DispatchTo"] = function() {
	this.disableKill();
};
zpartanlite.DispatchTo.__name__ = ["zpartanlite","DispatchTo"];
zpartanlite.DispatchTo.prototype = {
	func0: null
	,times0: null
	,func: null
	,times: null
	,length: null
	,tellEnabled: null
	,tellDisabled: null
	,kill: null
	,enableKill: function() {
		this.kill = this.killAll.$bind(this);
	}
	,disableKill: function() {
		this.kill = function() {
			haxe.Log.trace("Can't kill other listeners unless enableKill",{ fileName : "DispatchTo.hx", lineNumber : 63, className : "zpartanlite.DispatchTo", methodName : "disableKill"});
		};
	}
	,get_length: function() {
		if(this.func == null) {
			if(this.func0 != null) return 1; else return null;
		}
		return this.func.length;
	}
	,add: function(f_,once,amount) {
		if(this.get_length() == null) {
			this.func0 = f_;
			if(this.tellEnabled != null) this.tellEnabled();
			if(once != null) {
				if(once == true) this.times0 = 1; else this.times0 = -1;
			} else if(amount != null) this.times0 = amount; else this.times0 = -1;
			return;
		} else if(this.func == null) {
			this.func = new Array();
			this.times = new Array();
			this.func.push(this.func0);
			this.times.push(this.times0);
			this.func0 = null;
			this.times0 = null;
		}
		this.func.push(f_);
		if(once != null) {
			if(once == true) this.times.push(1); else this.times.push(-1);
		} else if(amount != null) this.times.push(amount); else this.times.push(-1);
	}
	,swap: function(current_,new_) {
		this.remove(current_);
		this.add(new_);
	}
	,remove: function(f_) {
		if(this.get_length() == null) return;
		if(this.get_length() == 1) {
			if(Reflect.compareMethods(f_,this.func0)) {
				this.func0 = null;
				this.times0 = null;
				if(this.tellDisabled != null) this.tellDisabled();
			}
			return;
		}
		var _g1 = 0, _g = this.func.length;
		while(_g1 < _g) {
			var i = _g1++;
			if(Reflect.compareMethods(this.func[i],f_)) {
				this.func.splice(i,1);
				this.times.splice(i,1);
			}
		}
		if(this.get_length() == 1) {
			this.func0 = this.func[0];
			this.times0 = this.times[0];
			this.func = null;
			this.times0 = null;
		}
	}
	,killAll: function() {
		if(this.get_length() == 1) {
			this.func0 = null;
			this.times0 = null;
			return;
		}
		var _g1 = 0, _g = this.func.length;
		while(_g1 < _g) {
			var i = _g1++;
			this.func.splice(i,1);
			this.times.splice(i,1);
		}
		this.func = new Array();
		this.times = new Array();
	}
	,dispatch: function() {
		if(this.get_length() == null) return;
		var count;
		if(this.get_length() == 1) {
			this.func0();
			if(this.times0 == -1) {
			} else {
				this.times0--;
				if(this.times0 == 0) this.remove(this.func0);
			}
			return;
		}
		var _g1 = 0, _g = this.func.length;
		while(_g1 < _g) {
			var i = _g1++;
			this.func[i]();
			count = this.times[i];
			if(count == -1) {
			} else {
				count--;
				this.times[i] = count;
				if(count == 0) this.remove(this.func[i]);
			}
		}
	}
	,__class__: zpartanlite.DispatchTo
	,__properties__: {get_length:"get_length"}
}
js.Boot.__res = {}
js.Boot.__init();
{
	var d = Date;
	d.now = function() {
		return new Date();
	};
	d.fromTime = function(t) {
		var d1 = new Date();
		d1["setTime"](t);
		return d1;
	};
	d.fromString = function(s) {
		switch(s.length) {
		case 8:
			var k = s.split(":");
			var d1 = new Date();
			d1["setTime"](0);
			d1["setUTCHours"](k[0]);
			d1["setUTCMinutes"](k[1]);
			d1["setUTCSeconds"](k[2]);
			return d1;
		case 10:
			var k = s.split("-");
			return new Date(k[0],k[1] - 1,k[2],0,0,0);
		case 19:
			var k = s.split(" ");
			var y = k[0].split("-");
			var t = k[1].split(":");
			return new Date(y[0],y[1] - 1,y[2],t[0],t[1],t[2]);
		default:
			throw "Invalid date format : " + s;
		}
	};
	d.prototype["toString"] = function() {
		var date = this;
		var m = date.getMonth() + 1;
		var d1 = date.getDate();
		var h = date.getHours();
		var mi = date.getMinutes();
		var s = date.getSeconds();
		return date.getFullYear() + "-" + (m < 10?"0" + m:"" + m) + "-" + (d1 < 10?"0" + d1:"" + d1) + " " + (h < 10?"0" + h:"" + h) + ":" + (mi < 10?"0" + mi:"" + mi) + ":" + (s < 10?"0" + s:"" + s);
	};
	d.prototype.__class__ = $hxClasses["Date"] = d;
	d.__name__ = ["Date"];
}
{
	Math.__name__ = ["Math"];
	Math.NaN = Number["NaN"];
	Math.NEGATIVE_INFINITY = Number["NEGATIVE_INFINITY"];
	Math.POSITIVE_INFINITY = Number["POSITIVE_INFINITY"];
	$hxClasses["Math"] = Math;
	Math.isFinite = function(i) {
		return isFinite(i);
	};
	Math.isNaN = function(i) {
		return isNaN(i);
	};
}
{
	String.prototype.__class__ = $hxClasses["String"] = String;
	String.__name__ = ["String"];
	Array.prototype.__class__ = $hxClasses["Array"] = Array;
	Array.__name__ = ["Array"];
	var Int = $hxClasses["Int"] = { __name__ : ["Int"]};
	var Dynamic = $hxClasses["Dynamic"] = { __name__ : ["Dynamic"]};
	var Float = $hxClasses["Float"] = Number;
	Float.__name__ = ["Float"];
	var Bool = $hxClasses["Bool"] = Boolean;
	Bool.__ename__ = ["Bool"];
	var Class = $hxClasses["Class"] = { __name__ : ["Class"]};
	var Enum = { };
	var Void = $hxClasses["Void"] = { __ename__ : ["Void"]};
}
{
	if(typeof document != "undefined") js.Lib.document = document;
	if(typeof window != "undefined") {
		js.Lib.window = window;
		js.Lib.window.onerror = function(msg,url,line) {
			var f = js.Lib.onerror;
			if(f == null) return false;
			return f(msg,[url + ":" + line]);
		};
	}
}
js.Lib.onerror = null;
divtastic.js.GlobalDiv._root = js.Lib.document;
jigsawx.JigsawMagicNumbers.dMore = 12;
jigsawx.JigsawMagicNumbers.dinout = 5;
jigsawx.JigsawMagicNumbers.ellipseSmallx = 3.;
jigsawx.JigsawMagicNumbers.ellipseSmally = 11 / 6;
jigsawx.JigsawMagicNumbers.ellipseLargex = 5.625;
jigsawx.JigsawMagicNumbers.ellipseLargey = 4.5;
jigsawx.JigsawMagicNumbers.stepSize = 10;
jigsawx.examples.JigsawDivtastic.videoSrc = "big_buck_bunny.webm";
jigsawx.examples.JigsawDivtastic.main()